package com.shop.coupon.controller;

import com.shop.common.core.domain.Result;
import com.shop.coupon.domain.Coupon;
import com.shop.coupon.domain.SkuFullReduction;
import com.shop.coupon.domain.SkuLadder;
import com.shop.coupon.service.SkuLadderService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/skuLadder")
public class SkuLadderController {
    private final SkuLadderService skuLadderService;

    public SkuLadderController(SkuLadderService skuLadderService) {
        this.skuLadderService = skuLadderService;
    }

    @GetMapping("/skuIdLadder")
    public Result<SkuLadder> skuIdLadder(@RequestParam Integer pageNum , Integer pageSize){
        return skuLadderService.skuIdLadder(pageNum,pageSize);
    }

    @PostMapping("/skuLadderUpdateRule")
    public Result<SkuLadder> skuLadderUpdateRule(@RequestBody SkuLadder skuLadder){
        return skuLadderService.skuLadderUpdateRule(skuLadder);
    }

    @PostMapping("/skuLadderInsert")
    public Result<SkuLadder> skuLadderInsert(@RequestBody SkuLadder skuLadder){
        return skuLadderService.skuLadderInsert(skuLadder);
    }

    @GetMapping("/skuLadderDelete")
    public Result<SkuLadder> skuLadderDelete(@RequestParam Long id){
        return skuLadderService.skuLadderDelete(id);
    }


    @GetMapping("/getSkuLadder")
    public Result<SkuLadder> getSkuLadder(@RequestParam Long id){
        return skuLadderService.getSkuLadder(id);
    }

}
